<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>排班第一个页面</title>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/js/jquery-easyui-1.5.5.6/locale/easyui-lang-zh_CN.js"/>"></script>
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/default/easyui.css"/>" />
<link rel="stylesheet" type="text/css"
	href="<c:url value="/js/jquery-easyui-1.5.5.6/themes/icon.css"/>" />
</head>
<style type="text/css">
</style>
<body>
	<div id="shq_paiban_div" class="easyui-panel"
		data-options="fit:true,border:false">
	<div style="padding: 1px; height: auto; background: #e0ecff">
		<!--< a class="easyui-linkbutton"
			data-options="iconCls:'icon-undo',text:'取消',plain:true"></a> --> <!-- <a
			class="easyui-linkbutton"
			data-options="iconCls:'icon-add',plain:true">上一步</a> --> <a
			class="easyui-linkbutton"
			data-options="iconCls:'icon-remove',plain:true"id="to_ftwes">下一步</a> 
			<!-- <a class="easyui-linkbutton"
			data-options="iconCls:'icon-reload',plain:true">回到第一步</a> -->
	</div>

	<div class="easyui-panel" data-options="fit:true" id="core_one">
		<div class="easyui-layout" data-options="fit:true">
			
			<!--  -->
			<div data-options="region:'center'" style="padding: 10px 20px">
				<div style="font-size: 14px;">参数设置</div>
				<div
					style="border-top: 2px solid #19aa8d; width: 600px; margin: 10px 0px; display: inline-block;"></div>
				<table id="ff" cellspacing="10">
					<tbody>
						<tr>
							<th><input class="easyui-textbox" id="core_pbid" value="${one.scheduId}"
								data-options="label:'  *排班编号', width:250,labelWidth:130" /></th>
						</tr>
						<tr>
							<th><input class="easyui-textbox" id="pbanname"  value="${one.scheduId}"
								data-options="label:'*名称', width:250,labelWidth:130" /></th>
						</tr>
						<tr>
							<th><input id="teamnames" class="easyui-combobox" name="" value="${ones.teamName}"
								data-options="label:'班组名称', valueField:'teamId',textField:'teamName',url:'to_findall_teamname',plain:true,panelHeight:'auto',width:300,labelWidth:130"
							/></th>
						</tr>
						<tr>
							<th><input class="easyui-datetimebox" id="jhksdade" value="${one.scheduEnabledate}"
								data-options="label:'*计划开始时日', width:300,labelWidth:130" /></th>
						</tr>
					</tbody>
				</table>
				
			
		<!--清单查找-->
	<div id="insertcorepb" class="easyui-dialog"
		data-options="
		width:450,
		title:'清单查找-排班模板',
		bodyCls:'awby',
		modal:true,
		closed:true,
		buttons:[{
				text:'关闭',
				iconCls:'icon-cancel',
				handler:function(){
					$('#insertcorepb').dialog('close');
				}
			}]">
		<div>
			<form action="">
				<table id="list_coreone">
					<tr>
						<td><input id="core_one_text" class="easyui-textbox"
							data-options="label:'名称', width:200,labelWidth:60" /></td>
					</tr>
					<tr>
						<td></td>
						<td><a id="core_one_button_one" class="easyui-linkbutton">模糊查询</a></td>
						<td><a id="core_one_button_two" class="easyui-linkbutton">精确查询</a></td>
					</tr>
				</table>
			</form>
		</div>
		<table class="easyui-datagrid" id="qpb_core"
			data-options="   
				method:'get',
				pagination:true,     
				url:'to_findall_findallspaiban',
				pageSize:10,     
				pageList: [10,20,30,40,50], 
				rownumbers:true,
				Striped:true, 
				singleSelect:true,
				striped:true
				">
			<thead>
				<tr>
					<th data-options="field:'SCHEDU_ID'">编号</th>
					<th data-options="field:'SCHEDU_NAME'">排版名称</th>
					<th data-options="field:'SCHEDU_ENABLEDATE',formatter:function(value,row,index){
					if(value!=null){
						var date = new Date(value);
						return date.toLocaleString();
					}
						return;
				}">开始日期</th>
				</tr>
			</thead>
			<tbody>
		
			</tbody>
		</table>
	</div>
	</div>
	</div>	
	</div>
</div>
	<script>
		$(function() {
			/* 清单查找 */
			$('#core_pbid').textbox({
				icons : [ {
					iconCls : 'icon-add',
					handler : function(e) {
						$("#insertcorepb").dialog("open");
						//双击获取值
						$('#qpb_core').datagrid({onDblClickRow:function(index,row){
								var paperinsertid=row.SCHEDU_ID;
								var paperinsertname=row.SCHEDU_NAME;
								var paperinsertdate=row.SCHEDU_ENABLEDATE;
								var date = new Date(paperinsertdate);
								$('#core_pbid').textbox("setValue",paperinsertid);
								$('#pbanname').textbox("setValue",paperinsertname);
								$('#jhksdade').textbox("setValue",date.toLocaleString());
								//关闭窗口
								$('#insertcorepb').dialog('close');
							}
						});
					}
				} ]
			});
			//下一步
			$('#to_ftwes').linkbutton({
				onClick : function() {
					var zhouqiid=$('#core_pbid').textbox("getValue");
					var teamId=$('#teamnames').combobox("getValue");
					var teamname=$('#teamnames').combobox("getText");
					if(zhouqiid==""||teamId==""||teamname==""){
						$.messager.alert('提示', '请将信息填写完整');
					}else{
					$("#shq_paiban_div").panel({
						href : "to_core_twe?zhouqiId="+zhouqiid+"&teamId="+teamId+"&teamname="+teamname
					});
					}
				}
			});
			function submitForm() {
				$('#ff').form(
						'submit',
						{
							onSubmit : function() {
								return $(this).form('enableValidation').form(
										'validate');
							}
						});
			}
			function clearForm() {
				$('#ff').form('clear');
			}

		});
		//模糊查询
		$("#core_one_button_one").linkbutton({
			onClick:function(){
				$("#qpb_core").datagrid({url:"to_findall_findallspaibanbynamemh?teamName="+$("#core_one_text").textbox("getText"),method:'get'});
			}
		});
		//精确查询
		$("#core_one_button_two").linkbutton({
			onClick:function(){
				$("#qpb_core").datagrid({url:"to_findall_findallspaibanbynamejq?teamName="+$("#core_one_text").textbox("getText"),method:'get'});
			}
		});
	</script>
</body>
</html>